home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / System Extras Headers / AOCE Headers / ADSPSecure.h next >
Encoding:
C/C++ Source or Header  |  1994-04-20  |  4.6 KB  |  195 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        ADSPSecure.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __ADSPSECURE__
  13. #define __ADSPSECURE__
  14.  
  15. #ifndef __ADSP__
  16. #include <ADSP.h>
  17. /*    #include <AppleTalk.h>                                        */
  18. /*        #include <Types.h>                                        */
  19. /*            #include <ConditionalMacros.h>                        */
  20. /*            #include <MixedMode.h>                                */
  21. /*                #include <Traps.h>                                */
  22. /*        #include <OSUtils.h>                                    */
  23. #endif
  24.  
  25. #ifndef __FILES__
  26. #include <Files.h>
  27. /*    #include <SegLoad.h>                                        */
  28. #endif
  29.  
  30. #ifndef __OCE__
  31. #include "OCE.h"
  32. /*    #include <Aliases.h>                                        */
  33. /*    #include <AppleEvents.h>                                    */
  34. /*        #include <Memory.h>                                        */
  35. /*        #include <Events.h>                                        */
  36. /*            #include <Quickdraw.h>                                */
  37. /*                #include <QuickdrawText.h>                        */
  38. /*                    #include <IntlResources.h>                    */
  39. /*        #include <EPPC.h>                                        */
  40. /*            #include <PPCToolBox.h>                                */
  41. /*            #include <Processes.h>                                */
  42. /*        #include <Notification.h>                                */
  43. /*    #include <Script.h>                                            */
  44. #endif
  45.  
  46. #ifndef __OCEAUTHDIR__
  47. #include "OCEAuthDir.h"
  48. #endif
  49.  
  50. #ifndef __TYPES__
  51. #endif
  52.  
  53. /* New ADSP control codes */
  54.  
  55. enum  {
  56.     sdspOpen                    = 229
  57. };
  58.  
  59. /*
  60. For secure connections, the eom field of ioParams contains two single-bit flags
  61. (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
  62. eom flag.  All other bits in that field should be zero.
  63.  
  64. To write an encrypted message, you must set an encrypt bit in the eom field of
  65. the ioParams of your write call. Note: this flag is only checked on the first
  66. write of a message (the first write on a connection, or the first write following
  67. a write with eom set.
  68. */
  69.  
  70. enum  {
  71.     dspEOMBit,
  72.     dspEncryptBit
  73. };
  74.  
  75. enum  {
  76.     dspEOMMask                    = 1 << dspEOMBit,
  77.     dspEncryptMask                = 1 << dspEncryptBit
  78. };
  79.  
  80. /*
  81. Define an ADSPSecure parameter block, as used for the secure Open call.
  82. */
  83.  
  84. #define sdspWorkSize 2048
  85.  
  86. #if defined(powerc) || defined (__powerc)
  87. #pragma options align=mac68k
  88. #endif
  89. struct TRSecureParams {
  90.     unsigned short                localCID;
  91.     unsigned short                remoteCID;
  92.     AddrBlock                    remoteAddress;
  93.     AddrBlock                    filterAddress;
  94.     unsigned long                sendSeq;
  95.     unsigned short                sendWindow;
  96.     unsigned long                recvSeq;
  97.     unsigned long                attnSendSeq;
  98.     unsigned long                attnRecvSeq;
  99.     unsigned char                ocMode;
  100.     unsigned char                ocInterval;
  101.     unsigned char                ocMaximum;
  102.     Boolean                        secure;
  103.     AuthKeyPtr                    sessionKey;
  104.     unsigned long                credentialsSize;
  105.     Ptr                            credentials;
  106.     Ptr                            workspace;
  107.     AuthIdentity                recipient;
  108.     UTCTime                        issueTime;
  109.     UTCTime                        expiry;
  110.     RecordIDPtr                    initiator;
  111.     Boolean                        hasIntermediary;
  112.     RecordIDPtr                    intermediary;
  113. };
  114. #if defined(powerc) || defined(__powerc)
  115. #pragma options align=reset
  116. #endif
  117.  
  118. typedef struct TRSecureParams TRSecureParams;
  119.  
  120. typedef struct SDSPParamBlock SDSPParamBlock;
  121. typedef SDSPParamBlock *SDSPPBPtr;
  122.  
  123. /*
  124.     SDSPIOCompletionProcs cannot be written in or called from a high-level 
  125.     language without the help of mixed mode or assembly glue because they 
  126.     use the following parameter-passing convention:
  127.  
  128.     typedef pascal void (*SDSPIOCompletionProcPtr)(SDSPPBPtr paramBlock);
  129.  
  130.         In:
  131.             =>     paramBlock                A0.L
  132.         Out:
  133.             none
  134. */
  135.  
  136. enum  {
  137.     uppSDSPIOCompletionProcInfo        = kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterA0,kFourByteCode)
  138. };
  139.  
  140. #if USESROUTINEDESCRIPTORS
  141. typedef pascal void (*SDSPIOCompletionProcPtr)(SDSPPBPtr paramBlock);
  142.  
  143. typedef UniversalProcPtr SDSPIOCompletionUPP;
  144.  
  145. #define CallSDSPIOCompletionProc(userRoutine, paramBlock)  \
  146.     CallUniversalProc((UniversalProcPtr)(userRoutine), uppSDSPIOCompletionProcInfo, (paramBlock))
  147.  
  148. #define NewSDSPIOCompletionProc(userRoutine)  \
  149.     (SDSPIOCompletionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine),  \
  150.     uppSDSPIOCompletionProcInfo, GetCurrentISA())
  151.  
  152. #else
  153. typedef ProcPtr SDSPIOCompletionUPP;
  154.  
  155. #define NewSDSPIOCompletionProc(userRoutine)  \
  156.     (SDSPIOCompletionUPP)((userRoutine))
  157.  
  158. #endif
  159.  
  160. #if defined(powerc) || defined (__powerc)
  161. #pragma options align=mac68k
  162. #endif
  163. struct SDSPParamBlock {
  164.     struct QElem                *qLink;
  165.     short                        qType;
  166.     short                        ioTrap;
  167.     Ptr                            ioCmdAddr;
  168.     SDSPIOCompletionUPP            ioCompletion;
  169.     OSErr                        ioResult;
  170.     char                        *ioNamePtr;
  171.     short                        ioVRefNum;
  172.     short                        ioCRefNum;
  173.     short                        csCode;
  174.     long                        qStatus;
  175.     short                        ccbRefNum;
  176.     union {
  177.         TRinitParams                initParams;
  178.         TRopenParams                openParams;
  179.         TRcloseParams                closeParams;
  180.         TRioParams                    ioParams;
  181.         TRattnParams                attnParams;
  182.         TRstatusParams                statusParams;
  183.         TRoptionParams                optionParams;
  184.         TRnewcidParams                newCIDParams;
  185.         TRSecureParams                secureParams;
  186.     }                            u;
  187. };
  188. #if defined(powerc) || defined(__powerc)
  189. #pragma options align=reset
  190. #endif
  191.  
  192.  
  193. #endif
  194.  
  195.